package com.hunt.controller;


import com.hunt.model.entity.OnlineStatisticsSerialize;
import com.hunt.service.OnlineStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author ww
 * @className
 * @description
 * @date 2020/6/12
 */

@Api(value = "用户在线统计模块")
@Controller
@RequestMapping("/onlineStatistics")
public class OnlineStatisticsController {
    
    @Autowired
    private OnlineStatisticsService onlineStatisticsService;

    @ApiOperation(value = "跳转至统计用户在线页面", httpMethod = "GET", produces = "text/html")
    @RequestMapping(value = "/onlineStatistics", method = RequestMethod.GET)
    public String toCustomerOnlineStatisticsPage() {
        return "system/onlineStatistics";
    }

    /**
     * 
     * @return
     */
    @ApiOperation(value = "获取统计用户数据api", httpMethod = "POST", produces = "text/html")
    @RequestMapping(value = "/getOnlineStatisticsData", method = RequestMethod.POST)
    @ResponseBody
    public OnlineStatisticsSerialize getOnlineStatisticsData(@RequestParam String getType){
        OnlineStatisticsSerialize onlineStatisticsSerialize = onlineStatisticsService.getOnlineStatisticsData(getType);
        return onlineStatisticsSerialize;
    }
}
